/*
    编写函数把一个数组中所有存储区的内容前后颠倒
*/
#include <stdio.h>
/*void func(int arr[],int size) {
    int num = 0, num1 = 4;
    for (num = size; num <= size + 4; num++) {
    	arr[num] = arr[num1];
	num1--;
    } 
}
int main() {
    int arr[10] = {1,2,3,4,5}, num = 0;
    func(arr,5);
    for (num = 5; num <=9; num++){
	printf("%d ", arr[num]);
    }
    printf("\n");
    return 0;
}*/
void reverse(int arr[], int size) {
    int pre = 0, post = size - 1;
    while(pre < post) {
	int tmp = arr[pre];
	arr[pre] = arr[post];
 	arr[post] = tmp;
	pre++;
	post--;
    }
}
int main() {
    int arr[] = {1,2,3,4,5,6,7}, num = 0;
    reverse(arr, 7);
    for(num = 0; num <= 6; num++) {
	printf("%d ", arr[num]);
    }
    printf("\n");
    return 0;
}
